﻿using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Text;

namespace Tools.Api.Http {

    /// <summary>
    /// 封装HTTP上下文请求
    /// </summary>
    public interface IHttper : ISession, ICookie {

        /// <summary>
        /// 当前请求的主机名
        /// TODO：IP6
        /// </summary>
        /// <returns>主机名</returns>
        string RequestHost();

        /// <summary>
        /// 获取一般常见的Request请求参数
        /// </summary>
        /// <returns>整合后的字典</returns>
        IDictionary<string, object> GetNormalRequestDict();

        /// <summary>
        ///     获取ip
        /// </summary>
        /// <returns></returns>
        string GetIp();

        /// <summary>
        /// 浏览器版本
        /// </summary>
        /// <returns></returns>
        string GetBrowserVersion();

        /// <summary>
        /// 格式化并整合POST参数字符串
        /// </summary>
        /// <returns></returns>
        NameValueCollection GetPostParams();

        /// <summary>
        /// 获取头部信息
        /// </summary>
        /// <returns></returns>
        NameValueCollection GetHeaders();

        /// <summary>
        /// 设置头部信息
        /// </summary>
        /// <param name="name">KEY</param>
        /// <param name="val">值</param>
        void SetHeader(string name, string val);

        /// <summary>
        /// 获取访问类型
        /// </summary>
        /// <returns></returns>
        string GetHttpMethod();

        /// <summary>
        /// 获取访问URL
        /// </summary>
        /// <returns></returns>
        string GetVisitUrl();

        /// <summary>
        /// 渲染类型
        /// </summary>
        /// <returns></returns>
        string GetPreferredRendering();

        /// <summary>
        /// 获得浏览器所承载的平台
        /// </summary>
        /// <returns></returns>
        string GetPlatform();

        /// <summary>
        /// 获取UserAgent信息
        /// </summary>
        /// <returns></returns>
        string GetUserAgent();
    }
}
